package com.aspose.cells;

public class ColorHelper {
   public static Color fromOleColor(int oleColor) {
      int var1 = oleColor >> 24 & 255;
      int var2 = oleColor >> 16 & 255;
      int var3 = oleColor & '\uffff';
      switch(var1) {
      case 0:
         return zast.d(oleColor);
      case 1:
         return a(var3);
      case 2:
         return Color.fromArgb(oleColor & 16777215);
      case 128:
         return a(var3);
      default:
         return Color.getEmpty();
      }
   }

   static Color a(int var0) {
      switch(var0) {
      case 0:
         return Color.fromArgb(-3618616);
      case 1:
         return Color.getBlack();
      case 2:
         return Color.fromArgb(-6703919);
      case 3:
         return Color.fromArgb(-4207141);
      case 4:
         return Color.fromArgb(-986896);
      case 5:
         return Color.getWhite();
      case 6:
         return Color.fromArgb(-10197916);
      case 7:
         return Color.getBlack();
      case 8:
         return Color.getBlack();
      case 9:
         return Color.getBlack();
      case 10:
         return Color.fromArgb(-4934476);
      case 11:
         return Color.fromArgb(-722948);
      case 12:
         return Color.fromArgb(-5526613);
      case 13:
         return Color.fromArgb(-13395457);
      case 14:
         return Color.getWhite();
      case 15:
         return Color.fromArgb(-986896);
      case 16:
         return Color.fromArgb(-6250336);
      case 17:
         return Color.fromArgb(-9605779);
      case 18:
         return Color.getBlack();
      case 19:
         return Color.fromArgb(-12366252);
      case 20:
         return Color.getWhite();
      case 21:
         return Color.fromArgb(-9868951);
      case 22:
         return Color.fromArgb(-1842205);
      case 23:
         return Color.getBlack();
      case 24:
         return Color.fromArgb(-31);
      default:
         return Color.getEmpty();
      }
   }

   public static int toOleColor(Color color, Workbook workbook) {
      return color.toArgb() & 16777215 | 33554432;
   }
}
